package com.demo.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.Headers;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.web.bind.annotation.RestController;

import com.demo.service.IMessageService;

@RestController
public class MessageController {
	@Autowired
	private IMessageService service;

	/**
	 * 字节传输
	 * 
	 * @param headers
	 * @param payload
	 *            有效载荷
	 * @throws Exception
	 */
	@MessageMapping("/server/byte")
	public void subscribeByte(@Headers Map<String, Object> headers, @Payload byte[] payload) {
		service.subscribeByte(headers, payload);
	}

}
